{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "bdb0f2e8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usunięto: b126s.csv\n",
      "Usunięto: b229l.csv\n",
      "Usunięto: b268s.csv\n",
      "Usunięto: b331l.csv\n",
      "Usunięto: b332s.csv\n",
      "Usunięto: b339l.csv\n",
      "Usunięto: b341l.csv\n",
      "Usunięto: b488s.csv\n",
      "Usunięto: b517l.csv\n",
      "Usunięto: b528s.csv\n",
      "Usunięto: b537l.csv\n",
      "Usunięto: b600s.csv\n",
      "Usunięto: b656s.csv\n",
      "Usunięto: b672s.csv\n",
      "Usunięto: b684s.csv\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "\n",
    "folder_x = 'foldy/fold_4/train/nonaf'\n",
    "folder_y = 'foldy/fold_4/test/nonaf'\n",
    "\n",
    "# Zbierz nazwy plików z folderu Y\n",
    "files_in_y = set(os.listdir(folder_y))\n",
    "\n",
    "# Iteruj po plikach w folderze X\n",
    "for file_name in os.listdir(folder_x):\n",
    "    full_path = os.path.join(folder_x, file_name)\n",
    "    if os.path.isfile(full_path) and file_name in files_in_y:\n",
    "        os.remove(full_path)\n",
    "        print(f\"Usunięto: {file_name}\")\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
